let mongoose = require('./db')
let userSchema = new mongoose.Schema({
    username:String,
    password:String,
    name:String,
    head:String,
    sex:String,
    phone:String,
    birthday:String,
    url:String,
    education:String,
    workTime:String,
    status:String,
    desc:String,
    audio:String,
    introduction:String,
    work:Object,
    study:Object,
})
let userModel = mongoose.model('user',userSchema)
// 公司
const companySchema=new mongoose.Schema({

    // 公司名称
    companyName:String,
    // 公司地址
    companyAddress:String,
    // 公司类型
    companyCate:String,
    // 公司人数
    companyNum:String,
    // 公司融资
    financing:String,
   
    
    // 是否感兴趣
    is_interested:{
        type:Boolean,
        default:false
    },

})

const companyModule=mongoose.model("company",companySchema)

// 职业
const careerScheam=new mongoose.Schema({

    // 职业名称
    careerName:String,
    // 学历
    xueli:String,
    // 薪资
    salary:String,
    // 经验
    experience:String,

    // 求职状态
    status:{
        type:Number,
        default:0
    },

    // 是否感兴趣
    is_interested:{
        type:Boolean,
        default:false
    },

     // 关联公司
     typeId:{
        type:mongoose.Types.ObjectId,
        ref:"company"
    },

 
})

const careerModule=mongoose.model("career",careerScheam)


module.exports = {
    userModel,companyModule,careerModule
}